package com.kalix.ksh.proint.biz;


import com.kalix.framework.core.impl.biz.GenericBizServiceImpl;
import com.kalix.ksh.proint.api.biz.IBsmBeanService;
import com.kalix.ksh.proint.api.biz.IBuildingBeanService;
import com.kalix.ksh.proint.api.dao.IBsmBeanDao;
import com.kalix.ksh.proint.api.dao.IBuildingBeanDao;
import com.kalix.ksh.proint.entities.BsmBean;
import com.kalix.ksh.proint.entities.BuildingBean;
import com.kalix.ksh.proint.entities.LineChartRequestBean;
import org.json.JSONObject;

import java.util.List;

/**
 *
 *
 * @auther: wanghongwei
 * @date: 2018/12/11 0011 18:31
 * @功能描述：bsn管理
 * @return:
 *
 */
public class BsmBeanServiceImpl extends GenericBizServiceImpl<IBsmBeanDao, BsmBean> implements IBsmBeanService {
    public BsmBeanServiceImpl(){
        super.init(BsmBean.class.getName());
    }

    @Override
    public String getBsmRoute() {
        String sql = "select li from BsmBean li";
        List<BsmBean> list = dao.find(sql);
        JSONObject jObject = new JSONObject();
        for (int i = 0; i < list.size() ; i++) {
            jObject.put(""+i+"",list.get(i).getBsmRoute());
        }

        return jObject.toString();
    }


}
